package com.lyy.controller;

import com.lyy.config.UserConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @Value("${msg}")
    private String msg;

    @Autowired
    private UserConfig user;

    @GetMapping("/sayHello")
    public String sayHello(){
        return msg;
    }

    @GetMapping("/test2")
    public UserConfig test2() {
        return user;
    }
}
